Skip to content

Latest commit

 

History

History
23 lines (14 loc) · 648 Bytes

File metadata and controls

23 lines (14 loc) · 648 Bytes

How to synchronous play a sound file on macOS?

on macOS, the command PLAY always play asynchronously.

If you want to play a sound synchronously, you must call afplay with LAUNCH EXTERNAL PROCESS

var $cmd; $err; $fileName; $in; $out : Text

$fileName:=Select document(""; ".mp3"; ""; 0)

If (OK=1)
	
	$cmd:="/bin/sh"
	$in:="afplay "+File(Document; fk platform path).path
	LAUNCH EXTERNAL PROCESS($cmd; $in; $out; $err)
	
End if 

19R5+

Take a look at the use of SystemWorkers with afplay to manage a playlist